/**
 * @author		Ben Layet
 * @version 	1.0
 * @date		25 Sep 2008
 */
package org.ignoramus.application.store;

import junit.framework.TestCase;

import org.ignoramus.application.model.AcquisitionStatus;
import org.ignoramus.application.model.Lesson;

/**
 *  Test for Lesson Builder class.
 */
public class LessonBuilderTest extends TestCase
{
	/**
	 * Test Creating a lesson from a store.
	 */
	public void testCreateLesson() throws Exception
	{
		LessonFile file = new LessonFile("junit/res/org/ignoramus/application/store/lesson.ign");
		LessonBuilder lessonBuilder = new LessonBuilder();
		Lesson lesson = lessonBuilder.createLesson(file);

		assertEquals(2, lesson.size());
		assertEquals("設計", lesson.get("1").getTitle());
		assertEquals("お菓子", lesson.get("2").getTitle());
		assertEquals("(n,vs) plan, design", lesson.get("1").getInformation("meaning"));
		assertEquals("I want to eat cakes.", lesson.get("2").getInformation("english example"));
		assertEquals("(n,vs) plan, design", lesson.get("1").getInformation("meaning"));
		assertEquals("I want to eat cakes.", lesson.get("2").getInformation("english example"));
		assertEquals(AcquisitionStatus.KNOWN, lesson.get("1").getKnowledge().getAcquisitionStatus());
		assertEquals(AcquisitionStatus.PARTIALLY_KNOWN, lesson.get("2").getKnowledge().getAcquisitionStatus());
		assertTrue( lesson.get("1").getKnowledge().getFadingLevel() > 1);
		
		
	}
}
